proc gmsg { conf serv nick text } {
set text [wrapper:xmlcrypt "$text"]
jlib::outmsg "<message to='$conf@$serv' type='groupchat' xml:lang='ru'><body>$nick: $text</body></message>"
}

proc pmsg { conf serv nick text } {
set text [wrapper:xmlcrypt "$text"]
jlib::outmsg "<message to='$conf@$serv/$nick' type='chat' xml:lang='ru'><body>$text</body></message>"
}

proc gm {from text} {
set text [wrapper:xmlcrypt "$text"]
jlib::outmsg "<message to='[user_from_jid $from]' type='groupchat' xml:lang='ru'><body>[resource_from_jid $from]: $text</body></message>"
}

proc pm {from text} {
set text [wrapper:xmlcrypt "$text"]
jlib::outmsg "<message to='$from' type='chat' xml:lang='ru'><body>$text</body></message>"
}

proc grm {from text} {
set text [wrapper:xmlcrypt "$text"]
jlib::outmsg "<message to='[user_from_jid $from]' type='groupchat' xml:lang='ru'><body>$text</body></message>"
}

proc qa {from type text} {
	set text [wrapper:xmlcrypt "$text"]
		if {"$type"=="groupchat"} {
			set to "[node_and_server_from_jid $from]"
		} else {
			set to "$from"
		}
	jlib::outmsg "<message to='$to' type='$type' xml:lang='ru'><body>[resource_from_jid $from]: $text</body></message>"
}